import React, {Component} from 'react';
import {StyleSheet, Text, View, Image, ScrollView} from 'react-native';
import {Button, WhiteSpace, WingBlank, Flex, Toast} from '@ant-design/react-native';
import {getCompanyBuildFileByBuildingID} from '~/api/company';
export default class ConfirmUseAgreement extends Component {
    static navigationOptions = {
        title: '车位认购协议（使用）',
    };

    constructor(props) {
        //调用基类的所有的初始化方法
        super(props);

        // 设置当前组件的属性
        this.state = {
            info: '',
            companyBuildingID: this.props.navigation.getParam('CompanyBuildingID'),
        };
        getCompanyBuildFileByBuildingID({
            buildingId: this.state.companyBuildingID,
            kindId: 99,
        }).then((r) => {
            if (r.code === 0) {
                this.setState({
                    info: r.data.FileContent,
                });
            } else {
                Toast.info(r.msg);
            }
        });
    } //
    render() {
        return (
            <ScrollView style={{flex: 1}}>
                <View style={{backgroundColor: 'white', width: '100%', height: '100%', padding: 10}}>
                    <Flex>
                        <Text>{this.state.info}</Text>
                    </Flex>
                </View>
            </ScrollView>
        );
    }
}

const styles = StyleSheet.create({
    images: {
        margin: 50,
        width: '50%',
        height: 180,
    },
});
